import 'package:flutter/cupertino.dart';
import '../../../widget/common_empty_view.dart';
import '../../cooperation/activity/my_act_list_view.dart';
import 'act_list_model.dart';

class HomeActListPage extends StatefulWidget {
  List? dataList = [];

  HomeActListPage({this.dataList, Key? key}) : super(key: key);

  @override
  State<HomeActListPage> createState() => _MyActListPageState();
}

class _MyActListPageState extends State<HomeActListPage> {
  @override
  Widget build(BuildContext context) {
    return widget.dataList!.isNotEmpty
        ? ListView.builder(
            itemCount: widget.dataList?.length,
            itemBuilder: (BuildContext context, int index) {
              return MyActListView(
                dataModel: widget.dataList?[index],
              );
            })
        : Offstage(
            offstage: widget.dataList!.isNotEmpty,
            child: const CommonEmptyView());
  }

  @override
  void initState() {
    super.initState();
    widget.dataList ??= [];
  }
}
